<?php
	$tests = array(
		'background-image: url(images/image1.gif);',
		'background-image: url (images/image2.gif);',
		'background-image : url(images/image3.gif);',
		'background-image : url (images/image4.gif);',
		'background-image : url ( images/image5.gif );',
		'background-image: url(\'images/image6.gif\'); color: red;',
        'background: url(images/image7.gif) no-repeat; width: 50px; height: 50px;',
        ' .gbts{background:url(//ssl.gstatic.com/gb/images/b_8d5afc09.png);_background:url(//ssl.gstatic.com/gb/images/b8_3615d64d.png);}',
        '<div style="background:url(images/srpr/logo3w.png) no-repeat;background-size:275px 95px;height:95px;width:275px">xxxx</div>',
        'background: url(images/image8.gif) no-repeat; width: 50px; height: 50px;',
	);
	
	foreach ($tests as $test) {
		preg_match('/(?<=[background-image|background])\s*:\s*url\s*\(\s*[\'"]{0,1}\s*([^\'"]*?)\s*[\'"]{0,1}\s*\)/i', $test, $matches);
		echo $matches[1], '<br>';
	}